#!/bin/bash

echo "ZooKeeper客户端连接工具"
echo "===================="
echo "请选择要连接的ZooKeeper节点:"
echo "1) zookeeper1 (端口: 2181)"
echo "2) zookeeper2 (端口: 2182)"
echo "3) zookeeper3 (端口: 2183)"
echo "4) 退出"
echo

read -p "请输入选择(1-4): " choice

case $choice in
    1)
        echo "连接到 zookeeper1..."
        docker exec -it zookeeper1 zkCli.sh
        ;;
    2)
        echo "连接到 zookeeper2..."
        docker exec -it zookeeper2 zkCli.sh
        ;;
    3)
        echo "连接到 zookeeper3..."
        docker exec -it zookeeper3 zkCli.sh
        ;;
    4)
        echo "退出"
        exit 0
        ;;
    *)
        echo "无效选择，请输入1-4之间的数字"
        exit 1
        ;;
esac 